<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <th:block th:include="include :: header('主题设置')" />
    <th:block th:include="include::bootstrap-select-css" />
</head>

<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <div class="tabs-container">
            <ul class="nav nav-tabs" id="config-title">
                <li class="active"><a data-toggle="tab" href="#index" aria-expanded="true">首页设置</a>
                </li>
                <li class=""><a data-toggle="tab" href="#docs" aria-expanded="true">文档设置</a>
                </li>
            </ul>
            <div class="tab-content">
                <!-- 首页设置 -->
                <div id="index" class="tab-pane active">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-index">
                           <div class="form-group">
                               <label class="col-sm-3 control-label is-">特色分类：</label>
                               <div class="col-sm-8">
                                   <input name="oly.web.theme.style.cat" th:value="${themeConfig['oly.web.theme.style.cat']}"
                                       class="form-control" type="number">
                               </div>
                           </div>
                           <div class="form-group">
                               <label class="col-sm-3 control-label is-">应用分类：</label>
                               <div class="col-sm-8">
                                   <input name="oly.web.theme.app.cat"
                                       th:value="${themeConfig['oly.web.theme.app.cat']}" class="form-control"
                                       type="number">
                                   </input>
                               </div>
                           </div>
                           <div class="form-group">
                               <label class="col-sm-3 control-label is-">技术分类：</label>
                               <div class="col-sm-8">
                                   <input name="oly.web.theme.skill.cat"
                                       th:value="${themeConfig['oly.web.theme.skill.cat']}" class="form-control"
                                       type="number">
                                   </input>
                               </div>
                           </div>
                           <div class="form-group">
                               <label class="col-sm-3 control-label is-">主题分类：</label>
                               <div class="col-sm-8">
                                   <input name="oly.web.theme.store.cat"
                                       th:value="${themeConfig['oly.web.theme.store.cat']}" class="form-control"
                                       type="number">
                                   </input>
                               </div>
                           </div>
                        </form>
                    </div>
                </div>
                <!-- 文档设置 -->
                <div id="docs" class="tab-pane">
                    <div class="panel-body">
                        <form class="form-horizontal m" id="form-docs">
                           <div class="form-group">
                               <label class="col-sm-3 control-label is-">文档分类：</label>
                               <div class="col-sm-8">
                                   <input name="oly.web.theme.docs.cat"
                                       th:value="${themeConfig['oly.web.theme.docs.cat']}" class="form-control"
                                       type="number">
                                   </input>
                               </div>
                           </div>
                        </form>
                    </div>
                </div>
           </div>
            <br>
            <button type="button" class="btn btn-w-m btn-primary center-block" id="submit-btn">修改</button>
        </div>
    </div>
        <th:block th:include="include :: footer" />
        <th:block th:include="include::bootstrap-select-js" />
        <script type="text/javascript" th:inline="javascript">
            var prefix = ctx + "cms/configBack";
            var myForm = "form-index";
            $('#config-title a').click(function (e) {
                e.preventDefault();
                $(this).tab('show');
                myForm = $(this).attr('href').replace("#", "form-");
            });
            function submitHandler() {
                $.operate.save(prefix + "/update/" + [[${ configGroup }]], $('#' + myForm).serialize());

            }
            $("#submit-btn").click(function () {
                submitHandler();
            })
        </script>
</body>

</html>